<!DOCTYPE html>
<html>
  <head>
    <title>账务分析系统</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="css/easyui/easyui.css">  
    <link rel="stylesheet" type="text/css" href="css/easyui/icon.css">  
    <link rel="stylesheet" type="text/css" href="css/easyui/AccountSys.css">  
    <link rel="stylesheet" type="text/css" href="css/FontRegular.css" />
    <script type="text/javascript" src="js/jquery-1.10.1.min.js"></script>  
    <script type="text/javascript" src="js/easyui/jquery.easyui.min.js"></script> 
    <script type="text/javascript" src="js/easyui/easyui-lang-zh_CN.js"></script> 
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
	<style type="text/css">
		#layout-top{ height:78px;background-color:#435b87; padding:0; margin:0;padding-left:30px;margin-bottom:3px;text-align:center}
		#layout-bottom{ height:15px;padding:0; margin:0;text-align:center}
		#Logo1{font-size:70px; text-align:center;font-family:'PasseroOne', "Times New Roman", serif;background:-webkit-linear-gradient(top,#f00,#ff0 45%,#0f0 50%,#f00);
			  -webkit-background-clip:text;
			  color:transparent}
		#Logo2{font-size:14px;color: #6B8E23; text-align:center}
    	#Logo3{font-size:20px;color:white; text-align:center}
    	.icon-account{ background:url('images/myaccount.gif') no-repeat center center;}
	</style>
	<script type="text/javascript">
		$(function (){
			$(this).ajaxStart(function(){
			    $("#overlay").show();
			  });
			$(this).ajaxStop(function(){
			    $("#overlay").hide();
			  });
			$("#overlay").show();
			$.post("/PoliceProject/servlet/AccountTreeMenuServlet",
	   			{
	
			   	},
			   	function(data){
			   		var nodes = [];
			   		var i = 0;
			   		var myaccount = 'images/myaccount.gif';
			   		$.each(data.jsonArray, function(i, val){
	          				nodes.push({ id:++i, text: val, iconCls: 'icon-account', state:'closed'});
			   		});
			   		$('#opTree').tree({data:nodes, onClick : f_treeItemClick});
			   		$("#overlay").hide();
			   },
			   "json" 
			);
			$('#mainMenu').accordion({  
			    border:false,  
			    onSelect:function(title){  
			        if (title == "单帐户")
			        {
			        	$.post("/PoliceProject/servlet/AccountTreeMenuServlet",
				   			{

						   	},
						   	function(data){
						   		var nodes = [];
						   		var i = 0;
						   		var myaccount = 'images/myaccount.gif';
						   		$.each(data.jsonArray, function(i, val){
				          				nodes.push({ id:++i, text: val, iconCls: 'icon-account', state:'closed'});
						   		});
						   		$('#opTree').tree({data:nodes, onClick : f_treeItemClick});
						   },
						   "json" 
						);
			        } 
			        else if(title == "多帐户")
			        {
			        	$.post("/PoliceProject/servlet/AccountTreeMenuServlet",
				   			{

						   	},
						   	function(data){
						   		var nodes = [];
						   		//var i = 0;
						   		var myaccount = 'images/myaccount.gif';
						   		$.each(data.jsonArray, function(i, val){
				          				nodes.push({ id:i, text: val, iconCls: 'icon-account', state:'closed'});
						   		});
						   		$('#multOpTree').tree({data:nodes, onClick : f_multTreeItemClick, checkbox : true, onlyLeafCheck : true});
						   },
						   "json" 
						);
			        }
			        else if (title = "数据处理")
			        {
			        	var nodes = [{
										"id":1,
										"text":"数据导入",
										"children":[{
											"id":11,
											"text":"批量导入数据"
											}, {
											"id":12,
											"text":"手动输入数据"
											}]
									 },
									 {
										"id":2,
										"text":"数据更新"
									 },
									 {
										"id":3,
										"text":"数据删除"
									}];
			        	$('#dataOpTree').tree({data:nodes, onClick : f_dataOpTreeItemClick});
			        }
			    }  
			});
			
			$('#directAccountBtn').click(function(){
				$.post("/PoliceProject/servlet/GetDirectAccountServlet",
		   			{
						//userBankAccount : $('#currentAccount').text()
				   	},
			   		function(data){
			   			
				   		var datas = [];
				   		var i = 0;
				   		$.each(data.jsonArray, function(i, val){
		          			datas.push({directAccount:val.userAccountNum, directName:val.directName, directIdentification:val.directIdentification, directMode:val.directMode});
				   		});
				   		$('#directInfo').datagrid({data: datas});
				   },
				   "json" 
				);
				$('#directAccount').window('open');
			});
			
			$('#directAccountOKBtn').click(function(){
				var row = $('#directInfo').datagrid('getSelected');

				if (row){
					$("#directAct").text(row.directAccount);
					$("#directAccountUserName").text(row.directName);
					$("#directAccountId").text(row.directIdentification);
					$("#directAccountMode").text(row.directMode);
				}
				var account = $('#currentAccount').text();
				var id = "#"+account;
				$(id).contents().find("#statisWindowOK").click();
				$('#directAccount').window('close');
			});
			
			$('#directAccountCancelBtn').click(function(){
				var account = $('#currentAccount').text();
				var id = "#"+account;
				$(id).contents().find("#statisWindowCancel").click(); 
				$('#directAccount').window('close');
			});
			
			$('#singleSortBtn').click(function(){
				$('#sortError').hide();
				$('#singleSort').window('open');
			});
			
			$('#singleSortOKBtn').click(function(){
				var sortMainType = $("#sortMainComb").combobox("getText");
				var sortSubType = $("#sortSubComb").combobox("getText");

				if (sortMainType == '未选择...' || sortSubType == '未选择...')
				{
					$('#sortErrorInfo').text("错误：请选择排序条件！");
					$('#sortError').show();
					return;
				}

				$('#singleSortMainType').text(sortMainType);
				$('#singleSortSubType').text(sortSubType);
				var account = $('#currentAccount').text();
				var id = "#"+account;
				$(id).contents().find("#sortWindowOK").click();
				$('#singleSort').window('close');
			});
			
			$('#singleSortCancelBtn').click(function(){
				var account = $('#currentAccount').text();
				var id = "#"+account;
				$(id).contents().find("#sortWindowCancel").click(); 
				$('#singleSort').window('close');
			});
			
			$('#singleCurveBtn').click(function(){
				$('#singleCurveError').hide();
				$('#singleCurve').window('open');
			});
			
			$('#singleCurveOKBtn').click(function(){
				var singleCurveType = $("#singleCurveComb").combobox("getText");
				if (singleCurveType == '未选择...')
				{
					$('#singleCurveErrorInfo').text("错误：请选择统计条件！");
					$('#singleCurveError').show();
					return;
				}
				var account = $('#currentAccount').text();
				$('#singleCurveBeginTime').text($('#singleWndCurveBeginTime').datebox('getValue'));
				$('#singleCurveEndTime').text($('#singleWndCurveEndTime').datebox('getValue'));
				$('#singleCurveInterval').text($('#singleWndCurveIntervalTime').val());
				$('#singleCurveCombText').text(singleCurveType);
				var id = "#"+account;
				$(id).contents().find("#curveWindowOK").click(); 
				$('#singleCurve').window('close');
			});
			
			$('#singleCurveCancelBtn').click(function(){
				var account = $('#currentAccount').text();
				var id = "#"+account;
				$(id).contents().find("#curveWindowCancel").click();
				$('#singleCurve').window('close');
			});
			
			$('#loadingOpenBtn').click(function(){
				$("#overlay").show();
			});
			
			$('#loadingCloseBtn').click(function(){
				$("#overlay").hide();
			});
		});
				
		function f_treeItemClick(node)
        {
        	var state = node.state;
        	if(state == "closed"){
        		var childrenNotes = $('#opTree').tree('getChildren', node.target);
				for(var i = 0; i < childrenNotes.length; ++i)
				{
					$('#opTree').tree('remove', childrenNotes[i].target);
				}
	        	$.post("/PoliceProject/servlet/AccountTreeSubMenuServlet",
		   			{
						bankName : node.text
				   	},
			   		function(data){
			   			
				   		var nodes = [];
				   		//var i = 0;
				   		var myaccount = 'images/myaccount.gif';
				   		$.each(data.jsonArray, function(i, val){
		          				nodes.push({ id:node.id.toString() + i, text: val, iconCls: 'icon-account'});
				   		});
				   		$('#opTree').tree('append', {parent : node.target, data:nodes});
				   		$('#opTree').tree('expand',node.target);
				   },
				   "json" 
				);
			}
			else if (state == "open")
			{
				
				$('#opTree').tree('collapse',node.target);
			}
        	else{
            	$('#tabs').tabs('add',{
				    title:node.text,  
				    //href : 'SubWeb/SingleUserPage.html',
				    content : "<iframe id='"+node.text+"' src='SubWeb/SingleUserPage.html' name='"+node.text+"' scrolling=no width=100% height=100% marginwidth=0 marginheight=0 frameborder=0></iframe>",
				    closable:true  
				});
				$("#currentAccount").text(node.text);
            }
        }
        
        function f_multTreeItemClick(node)
        {
        	var state = node.state;
        	if(state == "closed"){
        		var childrenNotes = $('#opTree').tree('getChildren', node.target);
				for(var i = 0; i < childrenNotes.length; ++i)
				{
					$('#multOpTree').tree('remove', childrenNotes[i].target);
				}
	        	$.post("/PoliceProject/servlet/AccountTreeSubMenuServlet",
		   			{
						bankName : node.text
				   	},
			   		function(data){
			   			
				   		var nodes = [];
				   		var i = 0;
				   		var myaccount = 'images/myaccount.gif';
				   		$.each(data.jsonArray, function(i, val){
		          				nodes.push({ id:node.id.toString() + ++i, text: val, iconCls: 'icon-account'});
				   		});
				   		$('#multOpTree').tree('append', {parent : node.target, data:nodes});
				   		$('#multOpTree').tree('expand',node.target);
				   },
				   "json" 
				);
			}
			else if (state == "open")
			{
				$('#multOpTree').tree('collapse',node.target);
			}
            else{
            	$('#tabs').tabs('add',{
				    title:node.text,  
				    //href : 'SubWeb/SingleUserPage.html',
				    content : "<iframe id='"+node.text+"' src='SubWeb/SingleUserPage.html' name='"+node.text+"' scrolling=no width=100% height=100% marginwidth=0 marginheight=0 frameborder=0></iframe>",
				    closable:true  
				});
				$("#currentAccount").text(node.text);
            }
        }
		function f_dataOpTreeItemClick(node)
        {
        	var state = node.state;
        	if(!state)
        	{
        		if (node.text == "批量导入数据")
        		{
	        		$('#tabs').tabs('add',{
					    title:node.text,  
					    
					    content : "<iframe id='importDatas' src='jsp/singleUser/dataImport.jsp' name='importDatas' scrolling=no width=100% height=100% marginwidth=0 marginheight=0 frameborder=0></iframe>",
					    closable:true  
					});
				}
        	}
        }
	</script>
  </head>
  
  <body class="easyui-layout">  
  		<div id="directAccount" class="easyui-window" title="直接账户信息列表" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:730px;height:500px;padding:10px;">
			<div class="easyui-layout" data-options="fit:true">
				<div data-options="region:'center',border:false" style="padding:10px;"> 
					<table class="easyui-datagrid" id="directInfo" title="账户基本信息" data-options="autoRowHeight:true">
				    	<thead>
				            <tr>
				                <th field="directAccount" width="200" align="center">银行账号</th>
				                <th field="directName" width="100" align="center">账户名</th>
				                <th field="directIdentification" width="250" align="center">身份证</th>
				                <th field="directMode" width="100" align="center">交易类型</th>
				            </tr>
				        </thead>
				    </table>
				</div>
				<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 10px;">
					<a id="directAccountOKBtn" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)">确 定</a>
					<a id="directAccountCancelBtn" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)">取 消</a>
				</div>
			</div>
		</div>
		<div id="singleSort" class="easyui-window" title="分类排序" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:400px;height:200px;padding:10px;">
			<div class="easyui-layout" data-options="fit:true">
				<div data-options="region:'center',border:false" style="padding:10px;"> 
			    	<span id="sortFram">排序条件:</span>
					<select id="sortMainComb" class="easyui-combobox">
						<option value='0'>未选择...</option>
						<option value='1'>对方帐户出现频率</option>
						<option value='2'>相同交易金额频率</option>
					</select>
					<select id="sortSubComb" class="easyui-combobox">
						<option value='0'>未选择...</option>
						<option value='1'>收入类交易</option>
						<option value='2'>支付类交易</option>
						<option value='3'>全部交易</option>
					</select>
				</div>
				<div id="sortError" style="margin:5px 0 5px 0">
					<span style="color:red" id="sortErrorInfo"></span>
				</div>
				<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 10px;">
					<a id="singleSortOKBtn" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)">确 定</a>
					<a id="singleSortCancelBtn" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)">取 消</a>
				</div>
			</div>
		</div>
		<div id="singleCurve" class="easyui-window" title="曲线图信息" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:600px;height:200px;padding:10px;">
			<div data-options="region:'center',border:false" style="padding:10px;"> 
				<div style="margin:10px">
		    	<span class="label">起始时间：</span>
		   		<input id="singleWndCurveBeginTime" class="easyui-datebox"/>
				<span class="label">结束时间：</span>
		   		<input type="text" id="singleWndCurveEndTime" class="easyui-datebox"/>
		   		</div>
		   		<div style="margin:0 10px 0 10px">
					<span class="label">间隔时长：</span>
					<input id="singleWndCurveIntervalTime" type="text"/>
					<span id="singleCurveFram">统计条件: </span>
					<select id="singleCurveComb" class="easyui-combobox">
						<option value='0'>未选择...</option>
						<option value='1'>根据流入流出资金量统计</option>
						<option value='2'>根据流入流出笔数统计</option>
					</select>
				</div>
				<div id="singleCurveError" style="margin:5px 0 5px 0">
					<span style="color:red" id="singleCurveErrorInfo"></span>
				</div>
			</div>
			<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 10px;">
				<a id="singleCurveOKBtn" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)">确 定</a>
				<a id="singleCurveCancelBtn" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)">取 消</a>
			</div>
		</div>
		
		<div id="overlay" class="overlay" style="display: none; z-index: 9998; left: 0; width: 100%; position: fixed; _position: absolute; top: 0; height: 100%">
			<div style="width: 100%;height: 100%;position: fixed; _position: absolute; top: 0;left: 0;background-color: #000;filter: alpha(opacity=5);moz-opacity: 0.05; opacity: 0.05;z-index: -1"></div>
			<div style="text-align:center; position: absolute;left: 50%;top: 50%;width:auto;height:auto">
				<table>
					<tr>
						<td>
							<img src="css/easyui/images/loading.gif"/>
						</td>
						<td>
							<span>正在加载数据, 请稍候...</span>
						</td>
					</tr>
				</table>
			</div>
		</div>
  		<div style="display: none">
  			<span id="currentAccount">currentAccount</span>
  			<span id="directAct">directAccount</span>
  			<span id="directAccountUserName">directAccountUserName</span>
  			<span id="directAccountId">directAccountId</span>
  			<span id="directAccountMode">directAccountMode</span>
  			<button id="directAccountBtn"></button>
  			<span id="singleSortMainType">singleSortMainType</span>
  			<span id="singleSortSubType">singleSortSubType</span>
  			<button id="singleSortBtn"></button>
  			<button id="singleCurveBtn"></button>
  			<span id="singleCurveBeginTime">singleCurveBeginTime</span>
  			<span id="singleCurveEndTime">singleCurveEndTime</span>
  			<span id="singleCurveInterval">singleCurveInterval</span>
  			<span id="singleCurveCombText">singleCurveComb</span>
  			<button id="loadingOpenBtn">loadingOpenBtn</button>
  			<button id="loadingCloseBtn">loadingOpenBtn</button>
  		</div>
        <div id="layout-top" data-options="region:'north', border:false" style="height:100px;">
        	<table align="left">
				<tr>
					<td id="Logo1" align="center">
						CG
					</td>
					<td id="LogonSubTable">
						<table align="center">
							<tr><td id="Logo3">账务分析系统</td></tr>
							<tr><td id="Logo2">Account Analyse</td></tr>		
						</table>
					</td>
				</tr>
			</table>
        </div>  
        <div id="layout-bottom" data-options="region:'south'" style="height:20px;">
        	<span id="copyright">CopyRight</span>
        </div>  
        <div data-options="region:'west'" title="功能菜单" style="width:300px;">  
            <div id="mainMenu" class="easyui-accordion" data-options="fit:true,border:false">  
                <div title="单帐户" data-options="selected:false"  style="padding:10px;">  
                    <ul id="opTree">  
    				</ul>  
                </div>  
                <div title="多帐户" data-options="selected:false" style="padding:10px;">
                	<div id="toolBar" style="text-align:'right';border:1px solid #ddd;margin:0px 0px 5px 0px; background-color:#FBEC88">
				        <a href="#" id="MultTreeReset" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-cancel'">重 置</a>
				        <a href="#" id="MultTreeOK" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-ok'">确 定</a>
				    </div>  
                    <ul id="multOpTree">  
    				</ul>   
                </div>  
                <div title="数据处理" data-options="selected:false" style="padding:10px">  
                    <ul id="dataOpTree">  
    				</ul>  
                </div> 
            </div>  
        </div>  
        <div data-options="region:'center',title:'信息窗口',iconCls:'icon-ok'">  
            <div id="tabs" class="easyui-tabs" data-options="fit:true,border:false,plain:true">  
                <div title="首页" data-options="href:'SubWeb/_content.html'" style="padding:10px"></div>   
            </div>  
        </div>  
  </body>
</html>
